import React, {Component} from "react";

export default class ReSizeComponent extends Component {
    constructor() {
        super();
        this.state={
            innerWidth: window.innerWidth
        }
    }
    componentDidMount() {
        window.addEventListener('resize', this.handleResize.bind(this));
    }
    componentWillUnmount() {
        window.removeEventListener('resize', this.handleResize.bind(this))
    }
    handleResize() {
        this.setState({
            innerWidth: window.innerWidth,
        })
    }
}
